#ifndef __PAXOS_H__
#define __PAXOS_H__

#ifdef PAXOS_BUILD
	#define PAXOS_API __declspec(dllexport)
#else
	#define PAXOS_API __declspec(dllimport)
#endif

/*proposal request and resp*/
typedef struct prepreq prepreq_t;
typedef struct prepres prepres_t;

/*accept req and resp*/
typedef struct accreq accreq_t;
typedef struct accres accres_t;

/*paxos class*/
typedef struct paxos_t *paxos_p;

/*public interface*/
PAXOS_API paxos_p paxos_new(char *id);
PAXOS_API void paxos_free(paxos_p *self_p);

/*private interface*/
int paxos_sndpreprq(paxos_p self, prepreq_t *preprq);
int paxos_sndpreprs(paxos_p self, prepres_t *preprs);
int paxos_sndaccreq(paxos_p self, accreq_t *accrq);
int paxos_sndaccres(paxos_p self, accres_t *accrs);
int paxos_delay(paxos_p self);


#endif
